System.register(["@angular/http", "ng2-layer", "@angular/core", "@angular/router"], function (exports_1, context_1) {
    "use strict";
    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var __metadata = (this && this.__metadata) || function (k, v) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
    };
    var __moduleName = context_1 && context_1.id;
    var http_1, ng2_layer_1, core_1, router_1, BoxBaseComp, _a;
    return {
        setters: [
            function (http_1_1) {
                http_1 = http_1_1;
            },
            function (ng2_layer_1_1) {
                ng2_layer_1 = ng2_layer_1_1;
            },
            function (core_1_1) {
                core_1 = core_1_1;
            },
            function (router_1_1) {
                router_1 = router_1_1;
            }
        ],
        execute: function () {
            BoxBaseComp = (function () {
                function BoxBaseComp(http, router, layer) {
                    var _this = this;
                    this.http = http;
                    this.layer = layer;
                    this.colors = ["FF5959", "F2CA00", "00E699", "5533FF", "FF7919", "44e645", "4DB1FE", "000000"];
                    this.icons = ["&#xe600;", "&#xe601;", "&#xe602;", "&#xe603;", "&#xe604;", "&#xe605;", "&#xe606;", "&#xe607;", "&#xe608;",
                        "&#xe609;", "&#xe60a;", "&#xe60b;", "&#xe60c;", "&#xe60d;", "&#xe60e;", "&#xe60f;", "&#xe610;", "&#xe611;",
                        "&#xe612;", "&#xe613;"];
                    router.parent.params.subscribe(function (params) {
                        http.get({
                            search: {
                                m: "Admin",
                                c: "ApiBox",
                                a: "getBoxInfoById",
                                box_id: params.id
                            }
                        }).then(function (data) {
                            _this.box = data.data;
                            _this.box.is_show = _this.box.is_show == "0" ? false : true;
                        });
                    });
                }
                BoxBaseComp.prototype.saveBox = function () {
                    var _this = this;
                    var box = this.box;
                    this.http.post({
                        search: {
                            m: "Admin",
                            c: "ApiBox",
                            a: "updateBox"
                        },
                        body: {
                            box_id: box.box_id,
                            name: box.name,
                            bg_img: box.bg_img,
                            color: box.color,
                            is_show: box.is_show ? "1" : "0"
                        }
                    }).then(function (data) {
                        _this.layer.tip({ message: "修改成功", align: "top" });
                    });
                };
                return BoxBaseComp;
            }());
            BoxBaseComp = __decorate([
                core_1.Component({
                    selector: '.box_base',
                    templateUrl: 'template/router/boxSetting/base.html'
                }),
                __metadata("design:paramtypes", [http_1.Http, router_1.ActivatedRoute, typeof (_a = typeof ng2_layer_1.NgLayer !== "undefined" && ng2_layer_1.NgLayer) === "function" && _a || Object])
            ], BoxBaseComp);
            exports_1("BoxBaseComp", BoxBaseComp);
        }
    };
});
